package com.ajx.cube.common.mvp;

import com.trello.rxlifecycle2.LifecycleProvider;


import java.util.Map;

import io.reactivex.Observable;

public abstract class BaseModel<T>  {

    //数据请求参数
    protected Map<String,Object> mParams;

    protected LifecycleProvider mLifecycle;
    /**
     * 设置数据请求参数
     */
    public  BaseModel params(Map<String,Object> map){
        mParams = map;
        return this;
    }

    /**
     *
     * @param lifecycleProvider
     * @return
     */
    public  BaseModel lifecycleProvider(LifecycleProvider lifecycleProvider){
        mLifecycle = lifecycleProvider;
        return this;
    }

    // 添加Callback并执行数据请求
    // 具体的数据请求由子类实现
    public abstract Observable<T>  execute(String action);



}
